﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CustomControls
{
    public partial class ResourcesControl : UserControl
    {
        public ResourcesControl()
        {
            InitializeComponent();
            Resources = new DBO.Economy.Resources();
            Points = 0;
        }

        private DBO.Economy.Resources resources;

        public DBO.Economy.Resources Resources
        {
            get { return resources; }
            set
            {
                resources = value;
                if (value == null)
                    return;
                WoodLabel.Text = value.Wood.ToString();
                StoneLabel.Text = value.Stone.ToString();
                GoldLabel.Text = value.Gold.ToString();
                FoodLabel.Text = value.Food.ToString();
            }
        }

        private int points;

        public int Points
        {
            get { return points; }
            set
            {
                points = value;
                PointsLabel.Text = value.ToString() + " pts";
            }
        }
    }
}
